﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria.GameInput;

namespace Terraria.UI
{
	// Token: 0x020000DF RID: 223
	public class GameInterfaceLayer
	{
		// Token: 0x06000B36 RID: 2870 RVA: 0x0000BD2D File Offset: 0x00009F2D
		public GameInterfaceLayer(string name, InterfaceScaleType scaleType)
		{
			this.Name = name;
			this.ScaleType = scaleType;
			this.Active = true;
		}

		// Token: 0x06000B37 RID: 2871 RVA: 0x003EAB58 File Offset: 0x003E8D58
		public bool Draw()
		{
			if (!this.Active)
			{
				return true;
			}
			Matrix transformMatrix;
			if (this.ScaleType == InterfaceScaleType.Game)
			{
				PlayerInput.SetZoom_World();
				transformMatrix = Main.GameViewMatrix.ZoomMatrix;
			}
			else if (this.ScaleType == InterfaceScaleType.UI)
			{
				PlayerInput.SetZoom_UI();
				transformMatrix = Main.UIScaleMatrix;
			}
			else
			{
				PlayerInput.SetZoom_Unscaled();
				transformMatrix = Matrix.Identity;
			}
			Main.spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, transformMatrix);
			bool result = this.DrawSelf();
			Main.spriteBatch.End();
			return result;
		}

		// Token: 0x06000B38 RID: 2872 RVA: 0x00008CF7 File Offset: 0x00006EF7
		protected virtual bool DrawSelf()
		{
			return true;
		}

		// Token: 0x04000F72 RID: 3954
		public readonly string Name;

		// Token: 0x04000F73 RID: 3955
		public InterfaceScaleType ScaleType;

		// Token: 0x04000F74 RID: 3956
		public bool Active;
	}
}
